import {createSlice} from '@reduxjs/toolkit';

const tabSlice=createSlice({
    name: 'tab',
    initialState: {
        isCollapse: false,
        tabList: [
          {
            path: '/',
            name: 'home',
            label:'首页'
          }
        ]

    },
    // 必须为纯函数，因为要被传给store里里面的reducers
    reducers: {
        // collapseMenu有两个参数，第一个是这个action，第二个是当前的state
          collapseMenu: state => {
            state.isCollapse =!state.isCollapse;
          },
          sekectMenuList: (state,{payload:val}) => {

          }
    }
})

export const {collapseMenu,sekectMenuList} = tabSlice.actions;
export default tabSlice.reducer;